package io.renren.modules.generator.enums;

import io.renren.constant.DeviceFinal;

/**
 * @ClassName EquipmentNumberComparisonEnum
 * @Description 设备-分区表对照枚举类
 * @Author zhengd
 * @Date 2020/9/11 23:26
 * @Version 1.0
 **/
public enum EquipmentNumberComparisonEnum {

    //挥发性有机物在线监测（VOCs）
    HJ21220200823001(0, DeviceFinal.gas_encrypt_01),
    HJ21220200823002(1,DeviceFinal.gas_encrypt_02),
    HJ21220200823003(2,DeviceFinal.gas_encrypt_03),
    HJ21220200823004(3,DeviceFinal.gas_encrypt_04),
    HJ21220200823005(4,DeviceFinal.gas_encrypt_05),
    HJ21220200823006(5,DeviceFinal.gas_encrypt_06),
    //水质监测
    HJ212A1100000001(6,DeviceFinal.water_encrypt_01),
    HJ212A1100000002(7,DeviceFinal.water_encrypt_02),
    HJ212A1100000003(8,DeviceFinal.water_encrypt_03),
    HJ212A1100000004(9,DeviceFinal.water_encrypt_04),
    HJ212A1100000005(10,DeviceFinal.water_encrypt_05),
    //多普勒超声波流量计
    Toran441080000013489(11,DeviceFinal.doppler_encrypt_01),
    Toran1440330101979(11,DeviceFinal.doppler_encrypt_02),
    //大气颗粒物
    HJ21220200901001(12,DeviceFinal.pm25_encrypt_01),
    HJ21220200901002(13,DeviceFinal.pm25_encrypt_02),
    HJ21220200901003(14,DeviceFinal.pm25_encrypt_03),
    HJ21220200901004(15,DeviceFinal.pm25_encrypt_04),
    //TODO 烟气监测
    SMOKE00001(16,DeviceFinal.smoke_encrypt_01),
    //TODO 大气粉尘监测
    TSP00001(17,DeviceFinal.tsp_encrypt_01),
    //TODO 可燃报警
    COMBALARM00001(18,DeviceFinal.combalarm_encrypt_01),
    OTHER(-1,"其他");

    /**
     * 代号
     */
    private int code;

    /**
     * 说明
     */
    private String message;

    EquipmentNumberComparisonEnum (int code, String message){
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String message(int code){
        for (EquipmentNumberComparisonEnum statusEnum : EquipmentNumberComparisonEnum.values()) {
            if (statusEnum.getCode() == code) {
                return statusEnum.getMessage();
            }
        }
        return OTHER.getMessage();
    }

}
